# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

_realname=semantic-version
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.10.0
pkgrel=2
pkgdesc="A library implementing the 'SemVer' scheme (mingw-w64)"
url='https://github.com/rbarrois/python-semanticversion'
license=('BSD')
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("$pkgname-$pkgver.tar.gz::https://github.com/rbarrois/python-semanticversion/archive/$pkgver.tar.gz")
sha256sums=('e234480908f633d2d80fdd97e87699135b2ed2fc9876b7f41d1d4a2d3262a0c4')

build() {
  cd "${srcdir}/python-semanticversion-$pkgver"

  ${MINGW_PREFIX}/bin/python setup.py build
}

package() {
  cd "${srcdir}/python-semanticversion-$pkgver"

  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 --skip-build

  install -Dm644 "${srcdir}/python-semanticversion-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
